<template>
  <div class="y-comment">
    <h1>评论</h1>
    <div class="y-comment-header">
      <el-avatar :src="user.avatar" style="margin-right: 10px"></el-avatar>
      <CommentEditor :editor-config="{
        emotionList:['❤️']
      }" style="flex: 9" @send="handleSend"></CommentEditor>
    </div>
    <h1>全部评论</h1>
    <div class="y-comment-body">
      <div class="y-comment-menu-box">
        <el-button>顺序</el-button>
        <el-button>热门</el-button>
      </div>
      <div class="y-comment-list">
        <Comment></Comment>
      </div>
    </div>
  </div>
</template>

<script>
import CommentEditor from "@/components/Comment/CommentEditor.vue";
import Comment from "@/components/Comment/Comment.vue";

export default {
  name: "YComment",
  components: {CommentEditor, Comment},
  data() {
    return {
      user: {
        avatar: "https://img1.baidu.com/it/u=1268603822,1552453616&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500",
      }
    }
  },
  methods: {
    handleSend(obj) {
      console.log(obj)
    }
  }
}
</script>

<style lang="less" scoped>
.y-comment {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;

  .y-comment-header {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
  }

  .y-comment-body {
    .y-comment-menu-box {
      display: flex;
      justify-content: flex-end;
    }

    .y-comment-list {

    }
  }

}
</style>